﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using XCode;
using XCode.DataAccessLayer;

namespace BingZi.HY.Core.Entities.Center
{
	/// <summary>
	/// 动态(公告)信息
	/// </summary>
	[Serializable]
	[DataObject]
	[Description("动态(公告)信息")]
	[BindTable("app_Trends", Description = "动态(公告)信息", ConnName = "Center", DbType = DatabaseType.SqlServer)]
	public partial class app_Trends
	{
		#region 属性
		private Int32 _TrendID;
		/// <summary>
		/// 编号
		/// </summary>
		[Description("编号")]
		[DataObjectField(true, true, false, 10)]
		[BindColumn(1, "TrendID", "编号", "", "int", 10, 0, false)]
		public Int32 TrendID
		{
			get { return _TrendID; }
			set { if (OnPropertyChange("TrendID", value)) _TrendID = value; }
		}

		private String _T_Title;
		/// <summary>
		/// 标题
		/// </summary>
		[Description("标题")]
		[DataObjectField(false, false, false, 128)]
		[BindColumn(2, "T_Title", "标题", "", "nvarchar(128)", 0, 0, true)]
		public String T_Title
		{
			get { return _T_Title; }
			set { if (OnPropertyChange("T_Title", value)) _T_Title = value; }
		}

		private String _T_Description;
		/// <summary>
		/// 描述
		/// </summary>
		[Description("描述")]
		[DataObjectField(false, false, false, 1073741823)]
		[BindColumn(3, "T_Description", "描述", "", "ntext", 0, 0, true)]
		public String T_Description
		{
			get { return _T_Description; }
			set { if (OnPropertyChange("T_Description", value)) _T_Description = value; }
		}

		private String _T_Photo;
		/// <summary>
		/// 图片
		/// </summary>
		[Description("图片")]
		[DataObjectField(false, false, true, 128)]
		[BindColumn(4, "T_Photo", "图片", "", "nvarchar(128)", 0, 0, true)]
		public String T_Photo
		{
			get { return _T_Photo; }
			set { if (OnPropertyChange("T_Photo", value)) _T_Photo = value; }
		}

		private DateTime _T_StartTime;
		/// <summary>
		/// 发布时间
		/// </summary>
		[Description("发布时间")]
		[DataObjectField(false, false, false, 3)]
		[BindColumn(5, "T_StartTime", "发布时间", "", "datetime", 3, 0, false)]
		public DateTime T_StartTime
		{
			get { return _T_StartTime; }
			set { if (OnPropertyChange("T_StartTime", value)) _T_StartTime = value; }
		}

		private DateTime _T_LastTime;
		/// <summary>
		/// 最后操作时间
		/// </summary>
		[Description("最后操作时间")]
		[DataObjectField(false, false, false, 3)]
		[BindColumn(6, "T_LastTime", "最后操作时间", "", "datetime", 3, 0, false)]
		public DateTime T_LastTime
		{
			get { return _T_LastTime; }
			set { if (OnPropertyChange("T_LastTime", value)) _T_LastTime = value; }
		}

		private Int32 _T_LastUserID;
		/// <summary>
		/// 最后操作用户
		/// </summary>
		[Description("最后操作用户")]
		[DataObjectField(false, false, false, 10)]
		[BindColumn(7, "T_LastUserID", "最后操作用户", "", "int", 10, 0, false)]
		public Int32 T_LastUserID
		{
			get { return _T_LastUserID; }
			set { if (OnPropertyChange("T_LastUserID", value)) _T_LastUserID = value; }
		}

		private Int32 _T_Top;
		/// <summary>
		/// 置顶1,正常0
		/// </summary>
		[Description("置顶1,正常0")]
		[DataObjectField(false, false, false, 3)]
		[BindColumn(8, "T_Top", "置顶1,正常0", "0", "tinyint", 3, 0, false)]
		public Int32 T_Top
		{
			get { return _T_Top; }
			set { if (OnPropertyChange("T_Top", value)) _T_Top = value; }
		}

		private Int32 _T_Red;
		/// <summary>
		/// 套红1,正常0
		/// </summary>
		[Description("套红1,正常0")]
		[DataObjectField(false, false, false, 3)]
		[BindColumn(9, "T_Red", "套红1,正常0", "0", "tinyint", 3, 0, false)]
		public Int32 T_Red
		{
			get { return _T_Red; }
			set { if (OnPropertyChange("T_Red", value)) _T_Red = value; }
		}
		#endregion

		#region 获取/设置 字段值
		/// <summary>
		/// 获取/设置 字段值。
		/// 一个索引，基类使用反射实现。
		/// 派生实体类可重写该索引，以避免反射带来的性能损耗
		/// </summary>
		/// <param name="name">字段名</param>
		/// <returns></returns>
		public override Object this[String name]
		{
			get
			{
				switch (name)
				{
					case "TrendID" : return _TrendID;
					case "T_Title" : return _T_Title;
					case "T_Description" : return _T_Description;
					case "T_Photo" : return _T_Photo;
					case "T_StartTime" : return _T_StartTime;
					case "T_LastTime" : return _T_LastTime;
					case "T_LastUserID" : return _T_LastUserID;
					case "T_Top" : return _T_Top;
					case "T_Red" : return _T_Red;
					default: return base[name];
				}
			}
			set
			{
				switch (name)
				{
					case "TrendID" : _TrendID = Convert.ToInt32(value); break;
					case "T_Title" : _T_Title = Convert.ToString(value); break;
					case "T_Description" : _T_Description = Convert.ToString(value); break;
					case "T_Photo" : _T_Photo = Convert.ToString(value); break;
					case "T_StartTime" : _T_StartTime = Convert.ToDateTime(value); break;
					case "T_LastTime" : _T_LastTime = Convert.ToDateTime(value); break;
					case "T_LastUserID" : _T_LastUserID = Convert.ToInt32(value); break;
					case "T_Top" : _T_Top = Convert.ToInt32(value); break;
					case "T_Red" : _T_Red = Convert.ToInt32(value); break;
					default: base[name] = value; break;
				}
			}
		}
		#endregion

		#region 字段名
		/// <summary>
		/// 取得动态(公告)信息字段名的快捷方式
		/// </summary>
		public class _
		{
			///<summary>
			/// 编号
			///</summary>
			public const String TrendID = "TrendID";

			///<summary>
			/// 标题
			///</summary>
			public const String T_Title = "T_Title";

			///<summary>
			/// 描述
			///</summary>
			public const String T_Description = "T_Description";

			///<summary>
			/// 图片
			///</summary>
			public const String T_Photo = "T_Photo";

			///<summary>
			/// 发布时间
			///</summary>
			public const String T_StartTime = "T_StartTime";

			///<summary>
			/// 最后操作时间
			///</summary>
			public const String T_LastTime = "T_LastTime";

			///<summary>
			/// 最后操作用户
			///</summary>
			public const String T_LastUserID = "T_LastUserID";

			///<summary>
			/// 置顶1,正常0
			///</summary>
			public const String T_Top = "T_Top";

			///<summary>
			/// 套红1,正常0
			///</summary>
			public const String T_Red = "T_Red";
		}
		#endregion
	}
}